<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no" />
	<title>首页</title>
	<link rel="stylesheet" type="text/css" href="../c/aui.css" />
	<link rel="stylesheet" type="text/css" href="../c/member.css" />
	<link rel="stylesheet" type="text/css" href="../c/article.css" />
	<link rel="stylesheet" type="text/css" href="../c/animate.css" />
	<!-- <link rel="stylesheet" type="text/css" href="../c/animate.css" /> -->
	<!-- <link rel="stylesheet" type="text/css" href="../c/swiper.min.css" /> -->
</head>

<body>
	<div id="_t" class="aui-hide" Tapmode onclick="_t()"></div>
	<div id="header">
		<a class="aui-pull-left aui-btn l" tapmode onclick="c()"> <img src="../i/left.png" /></a>
		<header class="aui-bar aui-bar-nav t" id="sx-header">
			<a class="aui-pull-left aui-btn" tapmode onclick="_close();"></a>
			<div class="aui-title">
				速翔网络
			</div>
			<a class="aui-pull-right aui-btn sx-btn" tapmode onclick="guanzhus()">
				<span>关注</span>
			</a>
		</header>
		<a class="aui-pull-right aui-btn r aui-hide" tapmode onclick="jubao()"> <img src="../i/right.png" /></a>
		<div class="sx-right-you aui-hide" tapmode onclick="member_right()">
			<img src="../i/member_right.png" />
		</div>
	</div>

	<div class="sx-t" id="datu" tapmode onclick="image('datu')">
	</div>
	<div class="aui-list aui-media-list sx-t-1">
		<div class="aui-list-item aui-list-item-middle">
			<div class="aui-media-list-item-inner">
				<div class="aui-list-item-media">
					<img src="../i/touxiang.png" class="aui-img-round aui-list-img-sm" id="userimg"  tapmode onclick="image('touxiang')">
					<span id="vip" style="	display: none " tapmode onclick="_url({url:'member_vip',title:'VIP会员'})">VIP</span>
				</div>
				<div class="aui-list-item-inner bj aui-hide" tapmode onclick="sz()">
					编辑资料
				</div>
				<div class="aui-list-item-inner sz aui-hide" tapmode onclick="_url({url:'member_user',title:'找好友'})">
					<img src="../i/sx-member-sz.png" />
				</div>
				<div class="aui-list-item-inner gz aui-hide guanzhu" tapmode onclick="guanzhus()">
					<img src="../i/member_user_gz.png" />关注
				</div>
				<div class="aui-margin-l-15 aui-list-item-inner aui-hide message" style="width:10rem;" tapmode onclick="message()">
					发消息
				</div>
			</div>
		</div>



		<div class="sx-username">
			<h2 tapmode onclick="username_ajax()"></h2>
			<p  tapmode onclick="fuzhi()"></p>
		</div>
<style>
#ad{border-radius:0.75rem;width: 100%; margin-bottom: 0.75rem;display:none;}
</style>
		<img tapmode onclick="_url({url:'renwu',title:'任务系统'})" id="ad" src="../i/ad.png" >


		<div class="qianbao aui-hide">
		 <!-- <h5>金</h5> -->
		 <div class="flex" tapmode onclick="_url({url:'renwu',title:'任务系统'})">
			 <div class="l">
				 <img src="../i/qianbao_1.png" >
				 <div class="text">
					 <b>0</b>
					 <p>我的金币</p>
				 </div>
			 </div>
			 <div class="r r1">
				 <img src="../i/qianbao_2.png" >
				 <div class="text">
					 <b>0</b>
					 <p>今日金币</p>
				 </div>
			 </div>
			 <div class="r r2">
				 <img src="../i/qianbao_2.png" >
				 <div class="text">
					 <b>0</b>
					 <p>昨日金币</p>
				 </div>
			 </div>
		 </div>
		</div>
<style>
#shop{
	color: #f1c40f;
	font-size: 0.7rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 0.1rem solid #232323 !important;
	border-bottom: 0.1rem solid #232323 !important;
	padding: 0.35rem 0;
}
#shop i.aui-icon-right{
	font-size: 0.6rem;
	font-weight: bold;
}
</style>
	 <!-- <div id="shop"><span>商品橱窗</span><i class="aui-iconfont aui-icon-right"></i></div> -->


		<div class="sx-info">
			<div class="sx-qianming" tapmode onclick="qianming()"></div>
			<div class="sx-tags" tapmode onclick="sz()"></div>
			<div class="sx-userinfo">
				<div tapmode onclick="huozan()">
					<b id="huozan">-</b><span>获赞</span>
				</div>
				<div tapmode onclick="user_fsgz_win(0)">
					<b id="guanzhu">-</b><span>关注</span>
				</div>
				<div tapmode onclick="user_fsgz_win(0)">
					<b id="fensi">-</b><span>粉丝</span>
				</div>
			</div>
		</div>
	</div>

	<div class="sx-list">
		<div class="aui-card-list-footer">
			<div class="a" tapmode onclick="list(0)"><span>作品<span id="zuopin_num"></span></span></div>
			<div tapmode onclick="list(1)"><span>社交<span id="article_num"></span></span></div>
			<div tapmode onclick="list(2)"><span>喜欢<span id="xihuan_num"></span></span></div>
		</div>
		<!--列表开始-->
		<script id="sx-list" type="text/x-dot-template">
			{{ for(var i=0,it=it.data; i < it.length; i++) { }}
			{{? activeIndex==1 }}
			{{? it[i].channel == 2}}
			<div class="aui-card-list video" id="id{{= it[i].id}}">
				<div class="aui-card-list-header aui-card-list-user" tapmode onclick="u({{= it[i].uid }})">
					<div class="aui-card-list-user-avatar">
						<img suxiangw-src="{{= it[i].user.img ? _img(it[i].user.img,60,60) : '../i/touxiang.png' }}" src='../i/touxiang.png' class="aui-img-round" />
					</div>
					<div class="aui-card-list-user-name">
						{{= it[i].user.username}}
					</div>
					<div class="aui-card-list-user-info">{{= it[i].time }}</div>
				</div>
				<div tapmode onclick="article({url:'article_view',id:{{= it[i].id}}})">
					{{? it[i].content }}<div class="content">{{= it[i].content }}</div>{{?}}
					<div class="aui-card-list-content-padded">
						<div class="aui-row">
							<div class="aui-col-xs-12">
								<img suxiangw-src="{{= _img(it[i].img,api.winWidth+200,api.winWidth) }}" src='../i/loading_200.png'  />
							</div>
							<div class="em"><em></em></div>
						</div>
					</div>
				</div>
				<div class="foot">
					<div class="l1" tapmode onclick="article({url:'article_view',id:{{= it[i].id}}})"><img src="../i/a_click.png"><p>{{= it[i].click}}</p></div>
					<div class="l2 zan" tapmode onclick="_zan({{= it[i].id}},'','','article')"><img src="../i/a_zan{{= it[i].user_zan?'-s':''}}.png"><p>{{= it[i].zan_num}}</p></div>
					<div class="l3" tapmode onclick="article({url:'article_view',id:{{= it[i].id}},gundong:1})"><img src="../i/a_ping.png"><p>{{= it[i].ping_num}}</p></div>
					<div class="l4" tapmode onclick="_fenxiang({id:{{= it[i].id}},_t:1,_name:'article',title:'{{= it[i].content}}',content:'{{= it[i].content}}'})"><img  style="width:1.2rem;" src="../i/a_fx.png"></div>
				</div>
			</div>
			{{??}}
			<div class="aui-card-list" id="id{{= it[i].id}}">
				<div class="aui-card-list-header aui-card-list-user" tapmode onclick="u({{= it[i].uid }})">
					<div class="aui-card-list-user-avatar">
						<img suxiangw-src="{{= it[i].user.img ? _img(it[i].user.img,60,60) : '../i/touxiang.png' }}" src='../i/touxiang.png' class="aui-img-round" />
					</div>
					<div class="aui-card-list-user-name">
						{{= it[i].user.username}}
					</div>
					<div class="aui-card-list-user-info">{{= it[i].time }}</div>
				</div>
				<div tapmode onclick="article({url:'article_view',id:{{= it[i].id}}})">
					<div class="content">{{= it[i].content }}</div>
					<div class="aui-card-list-content-padded">
						<div class="aui-row {{? it[i].images.length!=1}}sx-col4{{?}}">
						{{ for(var i_s=0,images=it[i].images; i_s < images.length; i_s++) { }}
						{{? i_s < 9}}
							{{? images.length==1}}
							<div class="aui-col-xs-12">
							<img suxiangw-src="{{= _img(images[i_s],api.winWidth+300)}}" src='../i/loading_200.png' /></div>
							{{?? images.length==2 || images.length==4}}
							<div class="aui-col-xs-6">
							<img suxiangw-src="{{= _img(images[i_s],api.winWidth)}}" src='../i/loading_200.png' /></div>
							{{??}}
							<div class="aui-col-xs-4">
							<img suxiangw-src="{{= _img(images[i_s],api.winWidth/2)}}" src='../i/loading_200.png' /></div>
							{{?}}
						{{?}}
						{{ } }}
						</div>
					</div>
				</div>
				<div class="foot">
					<div class="l1" tapmode onclick="article({url:'article_view',id:{{= it[i].id}}})"><img src="../i/a_click.png"><p>{{= it[i].click}}</p></div>
					<div class="l2 zan" tapmode onclick="_zan({{= it[i].id}},'','','article')"><img src="../i/a_zan{{= it[i].user_zan?'-s':''}}.png"><p>{{= it[i].zan_num}}</p></div>
					<div class="l3" tapmode onclick="article({url:'article_view',id:{{= it[i].id}},gundong:1})"><img src="../i/a_ping.png"><p>{{= it[i].ping_num}}</p></div>
					<div class="l4" tapmode onclick="_fenxiang({id:{{= it[i].id}},_t:1,_name:'article',title:'{{= it[i].content}}',content:'{{= it[i].content}}'})"><img  style="width:1.2rem;" src="../i/a_fx.png"></div>
				</div>
			</div>
			{{?}}
			{{??}}
			<div class="aui-col-xs-4" tapmode onclick="video_list({{= it[i].id}})" id="id{{= it[i].id}}" data-data='{{= JSON.stringify(it[i])}}'>
				<img class="sx-img" suxiangw-src="{{= _img(it[i].img,200,300,it[i].img?false:true) }}" src="../i/loading_300.png" />
				<div class="sx-text">
					<img src="../i/click.png" />
					<span>{{= it[i].click}}</span>
				</div>
			</div>
			{{?}}
			{{ } }}
		</script>
		<!--列表结束-->
		<div class="sx-li row" id="sx-view">
			<div id="loadingdi_huifu"><img src="../i/footer_progress.png" /></div>
		</div>

	</div>

</body>

<script type="text/javascript" src="../j/api.js"></script>
<script type="text/javascript">
	var header_h = 0,uid = 0,user_data,url,_user,activeIndex,pingmingshuaxin=true;
	apiready = function() {
		_user = _getPrefs('_user');
		_config = _getPrefs('_config');
if(adName){
	_init_ad();
	ad = api.require(adName);
}

		api.parseTapmode();
		if(api.winName == 'member_win_s'){
			if(_config.ad.ad){
				if(_config.ad.chaping == 2 && ad_vip){
					chaping();
				}
			}
		}else if(api.winName == 'member_win'){
			userdata(_getPrefs('_user'));
		}
		uid = api.winName == 'member_win_s' ? api.pageParam['uid'] : (_getPrefs('_user') ? _getPrefs('_user').id : '');

		// console.log(_getPrefs('_token'))

		if (!uid) {
			return _login();
		}

		url = 'video/lists/suid/'+uid;
		header();
		userinfo();

		// 回到屏幕
		api.addEventListener({
			name: 'viewappear'
		}, function(ret, err) {
			if(api.winName == 'member_win' && pingmingshuaxin){
				userinfo();
			}else{
				pingmingshuaxin = true;
			}
		});
		// 应用从后台回到前台事件
		api.addEventListener({
			name: 'resume'
		}, function(ret, err) {
			if(api.winName == 'member_win' && pingmingshuaxin){
				userinfo();
			}else{
				pingmingshuaxin = true;
			}
		});
		// 离开屏幕
		api.addEventListener({
			name: 'viewdisappear'
		}, function(ret, err) {

		});
		//应用进入后台事件
		api.addEventListener({
			name: 'pause'
		}, function(ret, err) {

		});
		// 监听滚动
		api.addEventListener({
			name : 'scrolltobottom',
			extra : {
				threshold : threshold //设置距离底部多少距离时触发，默认值为0，数字类型
			}
		}, function(ret, err) {
			if (heigutgao == 1) {// heigutgao=1开启执行 0停止执行   防止连续滚动，等加载数据之后在进行滚动。
				pagenum += 1
				_list({url:url,page:pagenum});
			}
		});


	}

	// 获取用户信息
	function userinfo() {
	//	console.log("用户id:"+api.pageParam['uid'] +" : "+ (_getPrefs('_user') ? _getPrefs('_user').id : '未登录0' ))
//		console.log('获取用户信息uid:' + uid);
		var urla = 'user/info';
		if(api.winName == 'member_win'){
			urla = 'member/info';
		}
		_ajax(urla, function(ret, err) {
			if (ret) {
		//		console.log("ajax获取用户："+JSON.stringify(ret));
				if (ret.err) {
					if(ret.err == '会员UID不正确，请重新获取token'){
						_uot();
					}
					_alert(ret.err, function(ret, err) {
						_close();
					})
				} else {
					userdata(ret);
					if(ret.lahei_s){
						$('#sx-view').html('<div id="lahei_text">对方已将您拉黑，无法查看视频</div>');
					}else{
						_list({url:url,page:1});
					}

					if(api.winName == 'member_win'){
						if(ret.msg){
							_tan(ret.msg);
						}
					}
				}
			} else {
				_alert(JSON.stringify(err))
			}
		}, {
			uid: uid
		})
	}
	// 顶部关注
	function guanzhu_cls(type){
		var _this = $('#guanzhu_'+uid);
		if(!type){
			$('.sx-btn').addClass('aui-hide');
			_this.removeClass('gz');
			_this.addClass('bj');
			_this.html('已关注');
			$('.message').removeClass('aui-hide');
		}else{
			$('.sx-btn').removeClass('aui-hide');
			_this.removeClass('bj');
			_this.addClass('gz');
			_this.html('<img src="../i/member_user_gz.png" />关注');
			$('.message').addClass('aui-hide');
		}
	}
	// 将用户信息输入界面
	function userdata(data) {
		if(api.winName == 'member_win'){
			if(_config.config.app == 1){

			}else{
				$('#ad').show();
				$('.jinbi').removeClass('aui-hide');
				$('.qianbao').removeClass('aui-hide');
				$('.qianbao .l .text b').text(_money(data.jinbi));
				$('.qianbao .r1 .text b').text(_money(data.jinbi_today));
				$('.qianbao .r2 .text b').text(_money(data.jinbi_yesterday));
			}
		}
		user_data = data;
		member_pai();
		$('.guanzhu').attr('id','guanzhu_'+uid)
		$('#userimg').attr('src', data.img ? _img(data.img, 100) : '../i/touxiang.png');
	//	console.log(data.img ? _img(data.img, 150) : '../i/touxiang.png')
		touxiang_img = data.img ? _img(data.img) : '../i/touxiang.png';
		username = data.username;

		if(data.datu){
			$('#datu').attr('style','background: url(\''+_img(data.datu,api.winWidth,$('#datu').height())+'\') no-repeat center center;background-size: cover');
		}

		datu_img = data.datu ? _img(data.datu) : '../i/user_by.png';

		$('.aui-title').text((data.nickname ? data.nickname : (data.mobile ? data.mobile : data.username)));
		if(data.username){
			$('.sx-username h2').html((data.nickname ? data.nickname : (data.mobile ? data.mobile : data.username)) + (

			_getPrefs('_user') ? api.pageParam['uid']==_getPrefs('_user').id ? (!_user.nickname ? '<em></em>' : '') : '' : ''
				)

			);
		}
		if(data.haoma){
			$('.sx-username p').text(_config.config.dtitle+'号：' + data.haoma);
		}
		$('.sx-qianming').text(data.qianming);

		if(api.winName == 'member_win'){
			if(_config.config.app == 1){

			}else{
				if(data.vip){
					$('#vip').show();
				}else{
					$('#vip').hide();
				}
			}
			_setPrefs('_user', data);
			// 个人主页
			$('.bj').removeClass('aui-hide');
			$('.sz').removeClass('aui-hide');

			// $('#wode').text(data.jinbi);
			// $('#jinru').text(data.jinbi_m);
		} else {
			// 别人主页
			// 是否关注
			$('.gz').removeClass('aui-hide')
			if (data.member_guanzhu) {
				guanzhu_cls();
			}else{
				guanzhu_cls(1);
			}
		}

		var _this = $('.sx-tags');
		var html = '';
		if (data.age) {
			html += '<span>' + (data.age == 1 ? '男' : '女') + '</span>';
		}
		if(data.birthday_name){
			html += '<span>' + data.birthday_name + '岁</span>';
		}
		if (data.city) {
			html += '<span>' + data.city + '</span>';
		}
		if (data.area) {
			html += '<span>' + data.area + '</span>';
		}
		if(html){
			_this.html(html);
		}

		$('#huozan').text(data.huozan);
		$('#guanzhu').text(data.guanzhu);
		$('#fensi').text(data.fensi);

		$('#zuopin_num').text(data.zuopin_num);
		$('#xihuan_num').text(data.xihuan_num);
		$('#article_num').text(data.article_num);

		// 头部用户昵称
		// api.execScript({
		//     frameName: 'member_header',
		//     script: "$api.text($api.dom('.aui-title'),'"+data.username+"');"
		// });

	}
	$(window).on('scroll', function() {
		var sTop = $(window).scrollTop();
		var _this = $('.sx-list .aui-card-list-footer');
		var addclass = $('.sx-list').offset().top;
		if (sTop >= (addclass - (header_h * 2))) {
			// api.execScript({
			// 	frameName: 'member_header',
			// 	script: 'wu("' + ((sTop - (addclass - (header_h * 2))) / header_h) + '")'
			// });
			$('#sx-header').css('opacity',((sTop - (addclass - (header_h * 2))) / header_h));
		} else {
			// api.execScript({
			// 	frameName: 'member_header',
			// 	script: 'wu("0")'
			// });
			$('#sx-header').css('opacity',0);
		}
		if (sTop >= (addclass - header_h)) {
			_this.css('top', header_h + 'px');
			_this.addClass('sx-fixed');
		} else {
			_this.css('top', '');
			_this.removeClass('sx-fixed');
		}
	});

	// 打开头部
	function header() {
		$api.fixStatusBar($api.dom('#header .t'));
		if (api.winName == 'member_win') {
			$api.addCls($api.dom('#header .l'),'aui-hide');
			$api.addCls($api.dom('#header .sx-btn'),'aui-hide');
			$('.sx-right-you').removeClass('aui-hide');
			$api.fixStatusBar($api.dom('.sx-right-you'));
		}else{
			$api.fixStatusBar($api.dom('#header .l'));
			$api.fixStatusBar($api.dom('#header .r'));
			$('#header .r').removeClass('aui-hide');
		}
		$api.fixStatusBar($api.dom('#header .l'));
		$api.fixStatusBar($api.dom('#header .r'));
		var header = $api.offset($api.dom('#sx-header'));
		header_h = header.h
	}
	// 获取头部高度
	function _header_h(h) {
		header_h = h
		console.log("头部高度：" + h);
	}

	function username_ajax(sz){
		if(api.winName == 'member_win'){
			api.prompt({
				title:'设置一个新名字',
				msg:'最多20个字符',
				buttons: ['取消', '确认'],
			}, function(ret, err) {
			    var index = ret.buttonIndex;
			    var nickname = ret.text;
					if(index == 2){
						if(!nickname){
							return _msg('名字不能为空');
						}
						_ajax('member/nickname',function(ret,err){
							if(ret){
								_msg(ret.ret?ret.ret:ret.err);
								if(ret.ret){
									_zhen();
									$('.sx-username h2').html(nickname +'<em></em>');
									if(sz){
										api.execScript({
										    name: 'member_sz',
										    frameName: 'member_sz',
										    script: 'nickname_name("'+nickname+'")'
										});
									}
								}
							}else{
								_alert(JSON.stringify(err))
							}
						},{nickname:nickname})
					}
			});
		}
	}
	// 打开设置
	function sz(){
		if(api.winName == 'member_win'){
			_url({url:'member_sz',title:'编辑资料'})
		}
	}
	// 打开编辑简介
	function qianming(){
		if(api.winName == 'member_win'){
			_url({url:'member_qianming',title:'修改简介'})
		}

	}
	// 打开图片
	function image(type){
		if(api.winName == 'member_win'){
			_image({img:type=='datu'?datu_img:touxiang_img,type:type})
		}else{
			_image({img:type=='datu'?datu_img:touxiang_img})
		}
	}
	function guanzhus(){
		if(user_data.lahei_s){
			return _msg('对方已将您拉黑，无法关注用户');
		}
		guanzhu(uid);
	}
	// 获赞
	function huozan(){
		var b = parseInt($('#huozan').text());
		api.openFrame({
			name : 'member_huozan',
			url : _h_w + 'member_huozan.html',
			bounces : false,
			rect : {
				x : 0,
				y : 0,
				w : 'auto',
				h : 'auto',
			},
			bgColor : 'rgba(0,0,0,0)',
			pageParam:{
				b:b
			},
			animation:{
				type:"fade",                //动画类型（详见动画类型常量）
					subType:"from_bottom",       //动画子类型（详见动画子类型常量）
					duration:100
			},
		})
	}
	// 收到首页用户信息
	function indexUserInfo(data){
		api.pageUp({top:true});
		data = json = eval('(' + data + ')');
		uid = data.user.id
		console.log("root获取用户："+JSON.stringify(data)+"\r\n");
		userdata(data.user);
	}
	// 关闭当前页面
	function c(){
		if(api.winName == 'root'){
			api.setFrameGroupIndex({
			    name: 'index',
			    index: 0,
					scroll:true,
			});
		}else if(api.winName == 'member_win_s'){
			_close();
		}else{
			_hone();
		}
	}
	// 发消息
	function message(){
		if(!_getPrefs('_user').vip){
			return _suxiangw_msg({content:'VIP会员专用功能，目前您还不是VIP'})
		}
		if(!user_data){
			return _msg('正在获取信息，请稍候再试！');
		}
		if(user_data.lahei_s){
			return _msg('对方已将您拉黑，无法发送消息');
		}
		_message('',{uid:user_data.id,img:user_data.img,nickname:user_data.username})
	}
	// 列表
	function list(a){
		activeIndex = a;
		if(activeIndex == 1){
			url = 'article/lists/suid/'+uid;
		}else if(activeIndex == 2){
			url = 'user/xihuan/uid/'+uid;
		}else{
			url = 'video/lists/suid/'+uid;
		}
		$('.sx-list .aui-card-list-footer .a').removeClass('a');
		var _this = $('.sx-list .aui-card-list-footer div').eq(activeIndex);
		_this.addClass('a');
		if(user_data.lahei_s){
			$('#sx-view').html('<div id="lahei_text">对方已将您拉黑，无法查看视频</div>');
			return;
		}
		$('#sx-view').html('<div id="loadingdi_huifu"><img src="../i/footer_progress.png" /></div>');
		_list({url:url,page:1});
	}
	// 取出当前 选项
	function tagType(){
		var _this = $('.sx-list .aui-card-list-footer .a');
		return {type:parseInt(_this.data('type')),page:parseInt(_this.data('page')),html:parseInt(_this.data('html'))};
	}
	// 打开滑动视频
	function video_list(id){
		var data = $('#id'+id).data('data');
		var a = url == 'user/xihuan/uid/'+uid ? 'xihuan' : 'zuopin'
		_video_list(data,a);
	}
	// 右侧
	function jubao(){
		if(!_getPrefs('_user')){
			return _login();
		}
		console.log(JSON.stringify(user_data.lahei))
		var b = [(user_data.lahei?'解除拉黑':'拉黑用户')];
		api.actionSheet({
				title: '请选择操作',
				cancelTitle: '取消',
				buttons: b
		}, function(ret, err) {
				var index = ret.buttonIndex;
				if(index == 1){
					if(user_data.lahei){
						_msg('解除拉黑');
						_ajax('member/lahei',function(ret,err){
							if(ret){
								user_data.lahei = null;
							}else{
								_alert(JSON.stringify(err))
							}
						},{uid_s:user_data.id})
					}else{
						api.confirm({
						    msg: 'TA将无法看到你在视频上的内容，确定要拉黑吗？',
						    buttons: ['确定', '取消']
						}, function(ret, err){
						    if( ret ){
									if(ret.buttonIndex == 1){
										_msg('已拉黑');
										_ajax('member/lahei',function(ret,err){
											if(ret){
												console.log(JSON.stringify(ret))
												user_data.lahei = 1;
											}else{
												_alert(JSON.stringify(err))
											}
										},{uid_s:user_data.id})
									}
						    }
						});
					}
					return;
					var b = ['低俗', '政治敏感','违法犯罪','广告营销','侮辱谩骂','未成年人不当行为','引人反感不适','其他'];
					api.actionSheet({
							title: '请选择举报内容',
							cancelTitle: '取消',
							buttons: b
					}, function(ret, err) {
							var index = ret.buttonIndex;
							if(index == b.length){
								api.prompt({
									buttons: ['确定', '取消'],
									title:'描述举报理由（250字内）'
							}, function(ret, err) {
									var index = ret.buttonIndex;
									var text = ret.text;
									if(index == 1){
										if(text){
											jubao_ajax(text);
										}else{
											_alert('内容不能为空')
										}
									}
							});
							}else if(index != b.length+1){
								jubao_ajax(b[index-1])
							}
					});
				}else if(index == 2){
					return;
					if(_getPrefs('lahei'+uid)){
						_removePrefs('lahei'+uid, uid);
						return _msg("已解除拉黑用户");
					}
					api.confirm({
					    msg: 'TA将无法看到你在视频上的内容，确定要拉黑吗？',
					    buttons: ['确定', '取消']
					}, function(ret, err){
					    if( ret ){
								if(ret.buttonIndex == 1){
									_setPrefs('lahei'+uid, uid);
									_msg("已被你加入黑名单");
								}
					    }
					});
				}
		});


	}
	function jubao_ajax(text){
		_loading()
		_ajax('member/jubao_user',function(ret,err){
			_loadingCloes();
			if(ret){
				_msg((ret.ret ? ret.ret : ret.err))
			}else{
				console.log(JSON.stringify(err));
			}
		},{uid:uid,content:text})
	}
	// 打开右侧
	function member_right(){
		$('#_t').removeClass('aui-hide');
		if(!_getPrefs('_user')){
			return _login();
		}//弹出层打开的时候
		api.openFrame({
			name : 'member_right',
			url : _h_w + 'member_right.html',
			bounces : false,
			rect : {
				x : api.winWidth - 200,
				y : 0,
				w : 200,
				h : 'auto',
			},
			bgColor : 'rgba(0,0,0,0)',
			animation:{
				type:"movein",               //动画类型（详见动画类型常量）
				subType:'from_right',
				duration:300
			},
		})
	}
	function _t(){
		$('#_t').addClass('aui-hide');
		api.closeFrame({name:'member_right'});
	}
	function fuzhi(){
		var clipBoard = api.require('clipBoard');
		clipBoard.set({
			value : _user.haoma
		}, function(ret, err) {
			if (ret) {
				_msg("复制成功")
			}
		});
	}
	function member_pai(){
		if(api.winName == 'member_win'){
			if(!user_data.zuopin_num){
				var t = 30;
				var w = 100;
				var h = 83+t;
				api.openFrame({
					 name: 'member_tishi',
					 url: _h_w + 'member_tishi.html',
					 rect: {
							 x: (api.winWidth / 2)-(w/2),
							 y: api.winHeight - h - 60 - api.safeArea.bottom,
							 w: w,
							 h: h,
					 },
					 bgColor: 'rgba(0,0,0,0)',
				});
			}else {
				api.closeFrame({
				    name: 'member_tishi'
				});
			}
		}
	}
	function user_fsgz_win(index){
		api.closeWin({
		    name: 'user_fsgz_win'
		});
		_url({index:index,uid:uid},'user_fsgz_win')
	}
	// 文章跳转
	function article(data){
		pingmingshuaxin = false;
		_url(data)
	}
	function u(id){
		if(id == uid){
			return;
		}
		_u(id);
	}
</script>

</html>
